import { stringify } from 'qs';
import request from '@/utils/request';

export async function queryIntegrals({ userId, ...params }) {
  return request(`/clover/api/v1/users/${userId}/integrals?${stringify(params)}`);
}

export async function removeIntegrals({ id, ...body }) {
  return request(`/clover/api/v1/integrals/${id}`, {
    method: 'DELETE',
    body,
  });
}

export async function updateIntegrals({ id, ...body }) {
  return request(`/clover/api/v1/integrals/${id}`, {
    method: 'PUT',
    body,
  });
}